<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="js/vue.js"></script>
</head>
<body>
    <div id="example">
        测试
    </div>
    
    <script>
        var data = { a: 1 }
        var vm = new Vue({
            el: '#example',
            data: data
        })
        
        console.log(vm.$data === data)
        console.log(vm.$el === document.getElementById('example'))
        vm.$watch('a', function (newValue, oldValue) {
            console.log('数据改变')
            console.log('newValue:' + newValue)
            console.log('oldValue:' + oldValue)
        })
    </script>
</body>
</html>